|   
          
          
         
		
		
[1]  
[2]  
[3]  
[4]  
[5]  
[6]
 
	HTML
The first and last tags in a document should  always be the HTML tags. These are the tags that tell a Web browser where the  HTML in your document begins and ends. The absolute most basic of all possible  Web documents is:  
<HTML>
 
</HTML>
That's it. If you were to load such a page into a  Web browser, it wouldn't do anything except give you a blank screen, but it is  technically a valid Web page. Obviously, you'll want more than that.  HEAD
The HEAD tags contain all of the document's header  information. When I say "header," I don't mean what appears at the  top of the browser window, but things like the document title and so on.  Speaking of which...  
   TITLE
This container is placed within the HEAD  structure. Between the TITLE tags, you should have the title of your document.  This will appear at the top of the browser's title bar, and also appears in the  history list. Finally, the contents of the TITLE container go into your  bookmark file, if you create a bookmark to a page.  
  What you type should probably be something which  indicates the document's contents, but it doesn't have to be. The length of the  title is pretty much unlimited, but don't go overboard. Users will either sneer  at or be confused by exceedingly long titles.  
  If you don't type anything between the TITLE tags,  or don't include the TITLE tags at all -- remember the blank document in the  HTML section earlier? -- then the browser will typically use the actual file  name for the title. Therefore, a document titled "TCh4ex4.html" will  have that name appear in the history list. Again, you can choose to do this,  but it will likely generate either confusion or contempt.  
 You should only have one TITLE container per  document. At one point, it was possible to create "dancing titles" by  including multiple TITLE tags. Not only is this a savage abuse of HTML, but the  effect can only be seen in certain versions of certain browsers. Therefore, it  should be avoided at all costs.  
 
BODY
BODY comes after the HEAD structure. Between the  BODY tags, you find all of the stuff that gets displayed in the browser window.  All of the text, the graphics, and links, and so on -- these things occur  between the BODY tags. We'll get to what happens there starting with the next  chapter.  
So, putting everything we've covered thus far into  one file, we have:  
  <HTML>
<HEAD>
<TITLE>Document Title</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML> 
 
This time, the result would be a document with a  completely blank browser window, but at least the words "Document  Title" would appear in the browser's history list.  
Comment Tags
If you want to leave yourself notes in an HTML  document, but don't want those notes to show up in the browser window, you need  to use the comment tag. To do that, you would do the following:  
  <!-- Hi, I'm a comment. --> 
 
Your note would go where the text Hi, I'm a  comment. appears. Yes, you do need an exclamation point after the opening  bracket, but not before the closing bracket. That's the way the standard  is written. I have no idea why. Also, there is no end tag; that is, a tag like  </!-- text --> does not exist. The comment tag is not a  container. This is our first example of an empty tag. 
  You can put comments pretty much anywhere, but you  have to be aware of one important thing: you shouldn't put any HTML markup  within a comment tag. Theoretically, you should be able to, but most browsers  handle this less than gracefully (i.e., they either mess up or crash).  
Headings 
  The heading structures are most commonly used to set apart  document or section titles. For example, the word "Headings" at the  beginning of this section is a heading. So is this document's title (it's at  the top of the page, in case you somehow missed it).  
Remember that these  heading structures go into the body of the document. The headings being  discussed here have nothing to do with the HEAD structure from the previous  chapter.  
There are six levels of headings, from Heading 1 through  Heading 6. Heading 1 (H1) is "most important" and Heading 6 (H6) is  "least important." By default, browsers will display the six heading  levels in the same font, with the point size decreasing as the importance of  the heading decreases. Here are all six HTML pairs, in descending order of  importance:  
   <H1>Heading  1</H1> 
     <H2>Heading  2</H2> 
     <H3>Heading  3</H3> 
     <H4>Heading  4</H4> 
     <H5>Heading  5</H5> 
     <H6>Heading  6</H6> 
  These six lines, when placed into an HTML document, will  simply display the six levels of headings. Take a look.  
Since, as we have discussed, whitespace doesn't matter, you  might think that the above block of HTML would just string the content into one  line of text. However, because headings are meant for section titles and the  like, they are defined as existing on a line by themselves. A heading always  begins at the margin of a line and always forces a line break at the end of the  heading. In other words, you cannot have two heading levels on the same line.  
This also means that you cannot highlight text in the middle  of a paragraph by marking it as a heading. If you try this, the paragraph will  be split in two, with the heading text on its own line between the two pieces.  (Later on, we'll talk about ways of highlighting text.)  
 If you have a  browser which is set close to its default settings, you'll notice that the text  for the last two headings gets pretty small. This leads to some page designers  using H6 for the fine print at the bottom of pages. This is a mistake, not to  mention an abuse of the heading structure. As you no doubt know, many browsers  allow the user to set the size of each element, including the headings. If a  user sets H6 to a size of 18 point, the fine print won't be so fine any more!  Remember: you cannot guarantee that your document will appear to other people  exactly as it does to you.  
[1]  
[2]  
[3]  
[4]  
[5]  
[6]
 
          |